using System;
using System.Linq;

namespace Se.Framework.Common.Config.Providers
{
    public class MultipleAssemblyTypeProvider : TypeProviderBase
    {
        public override Type GetTypeByClassName(string className)
        {
            Type result = null;
            foreach (var item in TypeProviderManager.Collection.OfType<AssemblyTypeProvider>().OrderBy(p => p.Order))
            {
                result = item.GetTypeByClassName(className);
                if (result != null)
                    return result;
            }
            return result;
        }
    }
}